package com.imoresoft.magic.action;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.imoresoft.magic.view.PageData;
import com.opensymphony.xwork2.ActionSupport;

public class BaseAction extends ActionSupport implements IBaseAction {

	private static final long serialVersionUID = 1L;

	protected final Logger logger = LoggerFactory.getLogger(this.getClass());

	protected PageData pd;

	protected BaseAction() {
		try {
			pd = new PageData();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void close() throws Exception {
		pd.close();
	}

	public void commit() throws Exception {
		pd.commit();
	}

	public void rollback() throws Exception {
		pd.rollback();
	}

	protected PageData getPageData() {
		return pd;
	}

	protected void setPageDate(PageData pd) {
		this.pd = pd;
	}
}
